import { reactive } from 'vue'
import * as api from '@/api/modules/analysis-model.api'

const enumList = [
  'modelType',
  'modelDataType',
  'tableJoinType',
  'modelFieldType',
  'modelNodeType',
  'modelConfType',
  'filterStrFunction',
  'filterNumFunction',
  'filterDateFunction',
  'complexOperator',
  'aggregatorFun',
  'alignment',
]
// 模型枚举
const enumStatus = reactive({})

const initEnum = async () => {
  const data = await api.getModelEnum(enumList)
  enumList.forEach(key => {
    enumStatus[key] = data[key] || {}
  })
}

initEnum()

export { enumStatus }
